﻿<!-- <!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>b</title>
<meta charset="utf-8" />
</head>
<body>
	<script src="https://cdn.bootcss.com/jsencrypt/2.3.1/jsencrypt.min.js"></script>
	<script src="../pubKey.js"></script>
	<h1>b Page</h1>
	<button id="a">获取加密秘钥</button>
	<br />
	<button id="b">解密</button>
	<script src="../jquery.min.js"></script>
	<script type="text/javascript">
		console.log("publicKey:" + publicKey);

		var encrypt = new JSEncrypt();
		encrypt.setPublicKey(publicKey);
		var text = "Hello World";
		console.log("加密前的字符：" + text);
		var enc2base64 = encrypt.encrypt(text);
		console.log("加密后的字符：" + enc2base64);
		text = enc2base64;

		var b = $("#b");
		b.on("click", function() {
			var postUrl = "./rsaDecode";
			console.log("解密前的字符：" + enc2base64);
			$.post(postUrl, JSON.stringify(enc2base64), function(data) {
				console.log(data.status);
			});
		});
	</script>
</body>
</html>
 -->